package com.dz.lm.service.usersend;

import com.dz.lm.common.dto.PageDto;
import com.dz.lm.common.exception.ServiceException;
import com.dz.lm.domain.usersend.UserSend;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @version 1.8;
 * @author: LDY;
 * @Description;
 * @Date: Created in 2020/3/8 17:16;
 */
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)

public interface UserSendService {
    /**
     *
     * @param userId
     * @param sendUid 邀请人
     * @param remark
     * @param productId 产品
     * @param fee 小费
     * @param platform 类型
     * @return
     * @throws ServiceException
     */
    int add(int userId,int sendUid,String remark,int productId,double fee,String platform) throws ServiceException;

    /**
     * 处理邀请
     * @param sendId
     * @param status  0-发送1接受-2-拒绝
     * @return
     * @throws ServiceException
     */
    int handle(int sendId,int status, String platform) throws ServiceException;

    /**
     * 查询人
     * @param userId 发起人
     * @param sendUid 邀请人
     * @param product 产品
     * @param status 0-发送1接受-2-拒绝
     * @return
     * @throws ServiceException
     */
    PageDto query(int pageNum,int rows,int userId,int sendUid,int product,int status) throws ServiceException;

    /**
     * 查询代理邀请数量
     * @param userId 发起人
     * @param sendUid 受邀人
     * @param productId 产品
     * @param status >-1 时 0-发送1接受-2-拒绝
     * @return
     * @throws Exception
     */
    int queryCount(int userId,int sendUid,int productId ,int status) throws ServiceException;

    int update(UserSend userSend)throws ServiceException;
}
